#ifndef _GLOBAL_H
#define _GLOBAL_H

/***************模式选择********************/
//注释掉将去掉imshow和cout...
//#define _DEBUG_ 1

//注释掉后关闭记录数据功能
//#define _RECORD_AVI_ 1

//曝光时间设置
#define EXPOSURETIME 5000

//定义相机
//#define _PENG_ 1
#define _HUGE_ 1
//#define _ONE_ 1
/***********************************************/

/***************基本参数********************/
//灰度阈值
#define GRAY_THRESHOLD_RED 80
#define GRAY_THRESHOLD_BLUE 70

//自定义世界坐标，小装甲片长宽比 13:5.5
#define SMALL_TARGET_WIDTH 140
#define SMALL_TARGET_HEIGHT 55

//自定义世界坐标，大装甲片长宽比 22.5:5.5
#define BIG_TARGET_WIDTH 225
#define BIG_TARGET_HEIGHT 55

//自定义世界坐标，装甲片深度
#define TARGET_DEPTH 7

//相机的分辨率！！！
#define CAM_WIDTH 640
#define CAM_HEIGHT 480
/***********************************************/

/***************装甲片识别条件********************/
//轮廓面积阈值,去除太小的面积
#define C_AREA 5
//待选灯柱的斜率阈值//********************有待确定！
#define K_THRESHOLD 1
//两个待选灯柱的斜率差阈值
#define DELTA_K_THRESHOLD 0.15
//两个待选灯柱最小外接矩形长的比值上限阈值      //1.3  0.7
#define RECT_MAX_THRESHOLD 1.8
//两个待选灯柱最小外接矩形长的比值下限阈值
#define RECT_MIN_THRESHOLD 0.5
//单个灯条长度阈值
#define MIN_LENGTH 5
//两平行灯条的最大距离
#define MAX_WIDTH 600
//两平行灯条的最小距离
#define MIN_WIDTH 3
//颜色得分的阈值
#define SCORE_THRESHOLD_BLUE 0.02
#define SCORE_THRESHOLD_RED 0.02
/***********************************************/

/****************颜色分割阈值********************/
//hsv_segment分割阈值
#define UPPER_S 255
#define UPPER_V 255

#define LOWER_S_BLUE 180
#define LOWER_V_BLUE 130

#define LOWER_S_RED_HIGH 140
#define LOWER_V_RED_HIGH 90
#define LOWER_S_RED_LOW 150
#define LOWER_V_RED_LOW 180
/***********************************************/

/****************************大神符***********************/
//#define USE_VIDEO 1
#define USE_RECOGNIZE 1
#define _BIGRUNEDEBUG_ 1
//#define _BIANXIE_ 1

//便携
//相机内参数矩阵
#define CAM_MATRIX_M_BIANXIE  4.7260566020330822e+02, 0., 3.1794067410074553e+02,\
                              0.,       4.7260566020330822e+02, 2.3874044027090105e+02,\
                              0., 0., 1.

//畸变矩阵
#define DISTCOEFFS_M_BIANXIE -3.6272803734899256e-01, 8.1717194392338516e-02,\
                             -6.4931581247071376e-03, 2.7185591570060624e-03,\
                             1.8714341862196952e-02

#define HU_PITCH_LOWER -75
#define HU_PITCH_UPPER -25
#define HU_YAW_LOWER -25
#define HU_YAW_UPPER 25

#define HU_DISTRAN_A -754.5
#define HU_DISTRAN_B -0.4819
#define HU_DISTRAN_C 297.4

#define PENG_PITCH_LOWER -65
#define PENG_PITCH_UPPER -15
#define PENG_YAW_LOWER -25
#define PENG_YAW_UPPER 25

#define PENG_DISTRAN_A -748.6
#define PENG_DISTRAN_B -0.4846
#define PENG_DISTRAN_C 308.8

/****************************大神符***********************/


/********************彭于晏********************/
//相机内参数矩阵
#define CAM_MATRIX_M_PENG  732.445158687766,-0.0242586111515201, 296.630455693537, \
                                     0,   730.313822118091, 239.707473655154, \
                                     0,                  0,                 1
//畸变矩阵
#define DISTCOEFFS_M_PENG -0.469166207683010,0.228300173695445,\
                          -0.00164433979366680,0.00145821130793040
//云台线性拟合
#define YAW_K_PENG -1.699
#define PITCH_K_PENG 1.709
//距离补偿
#define YAW_DIS_PENG 0.04
#define PITCH_DIS_PENG -0.02
#define YAW_B_PENG -39
#define PITCH_B_PENG -32
/***********************************************/

/********************胡歌********************/
//相机内参数矩阵：胡歌
#define CAM_MATRIX_M_HUGE  731.552893236366,0.137589398579062, 336.350752908930, \
                                     0,   730.848091495936, 242.751558908383, \
                                     0,                  0,                 1
//畸变矩阵：胡歌
#define DISTCOEFFS_M_HUGE -0.584034278476437,0.401658829635102,\
                                          0, 0
//云台线性拟合
#define YAW_K_HUGE -1.805
#define PITCH_K_HUGE 1.801
//距离补偿
#define YAW_DIS_HUGE 0.02
#define PITCH_DIS_HUGE -0.03
#define YAW_B_HUGE -18
#define PITCH_B_HUGE -45
/***********************************************/

/********************一号步兵********************/
//相机内参数矩阵：一号步兵
#define CAM_MATRIX_M_ONE   591.443483563154,    0.0817599213818650, 325.849669056083, \
                                     0,           592.397217718754, 249.770409331518, \
                                     0,                  0,         1
//畸变矩阵：一号步兵
#define DISTCOEFFS_M_ONE -0.469124053925065,0.225390288355600,\
                                          -0.000237135324679887, -0.00117492615881288
//云台线性拟合
#define YAW_K_ONE -1.805
#define PITCH_K_ONE 1.801
//距离补偿
#define YAW_DIS_ONE 0
#define PITCH_DIS_ONE -0.14
#define YAW_B_ONE -22
#define PITCH_B_ONE 0
/***********************************************/

//WiFi的设置
#define WIFI 1
#define SERVER_IP "192.168.2.163"



#endif
